<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>绑定属性 v-bind</title>
		<script src="../../vue/vue.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.active{
				color: red;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<!-- <a v-bind:href="ur" >百度一下
			<img v-bind:src="url" >
			<p class="div1">你好</p>
			<p v-bind:class="div1">你好</p> -->
			<p v-bind:class="{active:isActive}">{{mesage}}</p><!-- 对象语法 -->
			<p v-bind:class="[active]">{{mesage}}</p><!-- 数组语法 -->
			<p v-bind:class="getClass()">{{mesage}}</p><!-- 数组语法 方法调用-->
			<button type="button" v-on:click="btnClick">按钮</button>
		</div>
		<script type="text/javascript">
			var app = new Vue({
				/* 动态绑定class  */
				el:"#app",
				data:{
					mesage:'你好啊',
					/* url:'../../images/banner.jpg',
					ur:'http://www.baidu.com',
					div1:'div1', */
					isActive:true
					
				},
				methods:{
					btnClick:function(){
						this.isActive  = !this.isActive
					},
					getClass:function(){
						return [this.active]
					}
				}
			});
		</script>
	</body>
</html>
